home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11s.lha / HBBS / Source / Node / Node_Misc.c_ < prev    next >
Text File  |  1996-06-25  |  18KB  |  529 lines

  1.  
  2. #include <stdio.h>
  3. #include <exec/types.h>
  4. #include <libraries/locale.h>
  5. #include <exec/memory.h>
  6. #include <dos/dosextens.h>
  7. #include <intuition/screens.h>
  8. #include <intuition/intuition.h>
  9. #include <intuition/gadgetclass.h>
  10. #include <libraries/gadtools.h>
  11. #include <diskfont/diskfont.h>
  12. #include <utility/utility.h>
  13. #include <graphics/gfxbase.h>
  14. #include <devices/console.h>
  15. #include <workbench/workbench.h>
  16. #include <graphics/scale.h>
  17. #include <clib/locale_protos.h>
  18. #include <clib/exec_protos.h>
  19. #include <clib/wb_protos.h>
  20. #include <clib/intuition_protos.h>
  21. #include <clib/gadtools_protos.h>
  22. #include <clib/graphics_protos.h>
  23. #include <clib/utility_protos.h>
  24. #include <string.h>
  25. #include <clib/diskfont_protos.h>
  26.  
  27. #include <dos/dos.h>
  28. #include <dos/dostags.h>
  29. #include <stdlib.h>
  30. #include <stdio.h>
  31. #include <ctype.h>
  32. #include <libraries/reqtools.h>
  33.  
  34. #include <clib/alib_protos.h>
  35. #include <clib/dos_protos.h>
  36. #include <clib/reqtools_protos.h>
  37.  
  38. #include "NodeGUI.h"
  39.  
  40. extern struct ReqToolsBase *ReqToolsBase;
  41. extern ULONG InfoWinActive;
  42. extern ULONG *rttags;
  43.  
  44. #include "/common/ANSI_Codes.h"
  45. #include "/common/types.h"
  46. #include "/common/errors.h"
  47. #include "/common/defines.h"
  48. #include "/common/structures.h"
  49. #include "/common/strings.h"
  50. #include "/common/files.h"
  51.  
  52. #include "Node_Console_Protos.h"
  53. #include "Node_Serial_Protos.h"
  54. #include "Node_Main_Protos.h"
  55. #include "Node_Misc_Protos.h"
  56. #include "Node_Input_Protos.h"
  57. #include "/library/hbbscommon_protos.h"
  58. #include "/library/hbbscommon_pragmas.h"
  59. #include "nodelibrary/hbbsnode_protos.h"
  60. #include "nodelibrary/hbbsnode_pragmas.h"
  61.  
  62. extern int N_NodeNum;
  63. extern struct BBSGlobalData *BBSGlobal;
  64. extern struct NodeData *N_ND;
  65. extern struct Library *HBBSCommonBase;
  66. extern struct Library *HBBSNodeBase;
  67.  
  68. #include "/common/shared_protos.h"
  69.  
  70. short fposition(char *substr,char *str,ULONG startpos)
  71. {
  72.   // returns an character offset of a substring in a string
  73.   // this version is CASE SENSITIVE
  74.   // returns -1 if substring not found in the string
  75.  
  76.   char *whstr;
  77.   return((short)((whstr=strstr(str+startpos,substr)) ? (short)((LONG)whstr-(LONG)str) : -1));
  78. }
  79.  
  80. void strftcpy(char *dest,char *source,int from,int topos)
  81. {
  82.   int loop=from,pos=0;
  83.   if (from<=strlen(source)-1)
  84.   {
  85.     while (source[loop] && loop<=topos)
  86.     {
  87.       dest[pos]=source[loop];
  88.       loop++;
  89.       pos++;
  90.     }
  91.   }
  92.   dest[pos]=0;
  93. }
  94.  
  95. char *HBBS_AccessName(V_SMALLNUM Access)
  96. {
  97.   struct Node *node;
  98.   V_BIGNUM loop;
  99.   char tmpstr[10];
  100.   sprintf(tmpstr,"%d",Access);
  101.  
  102.   // check all access levels!
  103.   for (loop=0;loop<BBSGlobal->AcsLevels;loop++)
  104.   {
  105.     // get the level number node.
  106.     if(node=GetNode(BBSGlobal->AcsLevelList,loop))
  107.     {
  108.       // same as the level we want to find ?
  109.       if (stricmp(tmpstr,node->ln_Name)==0)
  110.       {
  111.         // yup, so get the name
  112.         if(node=GetNode(BBSGlobal->AcsLevelNames,loop))
  113.         {
  114.           // and return it!
  115.           return(node->ln_Name);
  116.         }
  117.       }
  118.     }
  119.   }
  120.   return(NULL);
  121. }
  122.  
  123. void PausePrompt(char *promptstr,ULONG Timeout)
  124. {
  125.   char prompt[BIG_STR];
  126.  
  127.   if ((promptstr && promptstr[0]==0) || (!promptstr))
  128.   {
  129.     MenuPrompt("Press [Return] to continue!",' ');
  130.   }
  131.   else
  132.   {
  133.     strcpy(prompt,promptstr);
  134.     HBBS_ModifyString(prompt);
  135.     PutText(prompt);
  136.   }
  137.  
  138.   Get_Line(GL_IMMEDIATE,'\0',1,Timeout,NULL);
  139.   PutText("\n\r");
  140. }
  141.  
  142. V_BOOL ContinuePrompt(char *promptstr,V_BIGNUM Flags)
  143. {
  144.   V_BOOL retval=FALSE;
  145.   char defaultchar='N';
  146.  
  147.   if (promptstr)
  148.   {
  149.     PutText(promptstr);
  150.   }
  151.   else
  152.   {
  153.     PutText(ANSI_RESET "Continue ");
  154.  
  155.   }
  156.   if (Flags & DCP_ADDYN)
  157.   {
  158.     if (Flags & DEFAULT_YES) defaultchar='Y';
  159.     // add to end of string
  160.     MenuPrompt("[Y]es, [N]o : ",defaultchar);
  161.   }
  162.  
  163.   strcpy(N_ND->CharsAllowed,"YyNn");
  164.  
  165.   Get_Line(GL_USECHARS|GL_DISPLAY|GL_EDIT|GL_IMMEDIATE,'\0',1,0,NULL);
  166.  
  167.   if (N_ND->OnlineStatus==OS_ONLINE)
  168.   {
  169.     if (((N_ND->CurrentLine[0]=='\0') && (Flags & DEFAULT_YES)) || (toupper(N_ND->CurrentLine[0])=='Y'))
  170.     {
  171.       retval=TRUE;
  172.     }
  173.     else
  174.     {
  175.       retval=FALSE;
  176.     }
  177.   }
  178.  
  179.   return(retval);
  180. }
  181.  
  182. void DisplayBuffer(UBYTE *Buffer,ULONG Length,BOOL CheckSequences)
  183. {
  184.   char *errorstr="<ERROR>";
  185.   ULONG bufferpos=0,linepos;
  186.   UBYTE LineBuffer[BIG_STR],checkstr[BIG_STR],tmpstr[BIG_STR],formatstr[20],outstr[BIG_STR],doorname[BIG_STR],dooroptions[BIG_STR];
  187.   BOOL GotLine,Done;
  188.   short startpos,endpos;
  189.  
  190.   PutText(ANSI_RESET);
  191.   do
  192.   {
  193.     GotLine=FALSE;
  194.     for (linepos=0;(bufferpos<Length) && (linepos<BIG_STR-1) && (!GotLine);bufferpos++) // -1 for null terminator that needs to be added
  195.     {
  196.  
  197. // *C* check code sizes and times of the two methods..
  198. // ok, there are two ways to check the data, here's the first, it's a bit more structured
  199.  
  200.       switch (Buffer[bufferpos])
  201.       {
  202.         case '\n':
  203.           LineBuffer[linepos++]='\n';
  204.           LineBuffer[linepos++]='\r';
  205.           if (Buffer[bufferpos+1]=='\r')
  206.           {
  207.             bufferpos++;
  208.           }
  209.           GotLine=TRUE;
  210.           break;
  211.  
  212.         case '\0':
  213.           break;
  214.         default:
  215.           LineBuffer[linepos++]=Buffer[bufferpos];
  216.           break;
  217.       }
  218.  
  219. // and this is the second, less structured way of doing it..
  220. /*
  221.       if (Buffer[bufferpos]=='\n')
  222.       {
  223.         LineBuffer[linepos++]='\n';
  224.         LineBuffer[linepos++]='\r';
  225.         if (Buffer[bufferpos+1]=='\r')
  226.         {
  227.           bufferpos++;
  228.         }
  229.         GotLine=TRUE;
  230.       }
  231.       else
  232.       {
  233.         if (Buffer[bufferpos]!='\0')
  234.         {
  235.           LineBuffer[linepos]=Buffer[bufferpos];
  236.           linepos++;
  237.         }
  238.       }
  239. */
  240.     }
  241.     LineBuffer[linepos]=0;
  242.  
  243.     if (CheckSequences)
  244.     {
  245.       Done=FALSE;
  246.       strcpy(tmpstr,LineBuffer);
  247.       LineBuffer[0]=0;
  248.  
  249.       while (!Done)
  250.       {
  251.         Done=TRUE;
  252.  
  253.         // is there a sequence introducer in the buffer ?
  254.  
  255.         if ((startpos=position("@^",tmpstr))>=0)
  256.         {
  257.           // yup, but is it followed by a sequence terminator ?
  258.           if ((endpos=fposition("@",tmpstr,startpos+2))>=0)
  259.           {
  260.             // yes it is. so make sure we check for more sequences when we've done this one
  261.             Done=FALSE;
  262.  
  263.             // get the sequence from the buffer.. missing off the introducer
  264.             // and the terminator, i.e. the bit between the @^ and the @
  265.  
  266.             strftcpy(checkstr,tmpstr,startpos+2,endpos-1);
  267.  
  268.             // copy the normal text to the output buffer.
  269.  
  270.             if (startpos) strncat(LineBuffer,tmpstr,startpos);
  271.  
  272.             // modify our temporary buffer..
  273.  
  274.             strfcpy(tmpstr,tmpstr,endpos+1);
  275.  
  276.  
  277.  
  278.             formatstr[0]=0;
  279.             if ((startpos=position("^",checkstr))>=0)
  280.             {
  281.               if (startpos)
  282.               {
  283.                 strftcpy(formatstr,checkstr,0,startpos-1);
  284.               }
  285.               strfcpy(checkstr,checkstr,startpos+1);
  286.             }
  287.  
  288.             StripSpaces(checkstr);
  289.             if ((startpos=position(" ",checkstr))>=0)
  290.             {
  291.               strNcpy(doorname,checkstr,startpos);
  292.               strftcpy(dooroptions,checkstr,startpos,strlen(checkstr)-1);
  293. /*
  294.               PutText(doorname);
  295.               PutText("\n\r");
  296.               PutText(dooroptions);
  297.               PutText("\n\r");
  298. */
  299.             }
  300.             else
  301.             {
  302.               strcpy(doorname,checkstr);
  303.               dooroptions[0]=0;
  304.             }
  305.             if (stricmp(formatstr,"SYSDOOR")==0) GoSystemDoor(doorname,dooroptions); else
  306.             if (stricmp(formatstr,"USERDOOR")==0) GoUserDoor(doorname,dooroptions); else
  307.             if (stricmp(formatstr,"SCREEN")==0) DisplayScreen(checkstr); else
  308.             if (stricmp(formatstr,"SSCREEN")==0) DisplaySpecialScreen(checkstr); else
  309.             if (stricmp(formatstr,"PAUSE")==0) PausePrompt(checkstr,0); else
  310.             if (stricmp(formatstr,"TPAUSE")==0) PausePrompt(NULL,atol(checkstr)); else
  311.             if (stricmp(formatstr,"CLS")==0) PutText(ANSI_CLS); else
  312.             {
  313.  
  314.               // check checkstr against table and store result in same variable.
  315.  
  316.               if (stricmp("BBSName",checkstr)==0) strcpy(checkstr,BBSGlobal->BBSName); else
  317.               if (stricmp("BBSLocation",checkstr)==0) strcpy(checkstr,BBSGlobal->BBSLocation); else
  318.               if (stricmp("BBSCountry",checkstr)==0) strcpy(checkstr,BBSGlobal->BBSCountry); else
  319.               if (stricmp("Sysop",checkstr)==0) strcpy(checkstr,BBSGlobal->SysopAccount); else
  320.  
  321.               if (stricmp("BBSSerial",checkstr)==0) sprintf(checkstr,"%d",BBSGlobal->BBSSerial); else
  322.               if (stricmp("BBSNodes",checkstr)==0) sprintf(checkstr,"%d",BBSGlobal->BBSNodes); else
  323.               if (stricmp("TotalUsers",checkstr)==0) sprintf(checkstr,"%d",BBSGlobal->TotalUsers); else
  324.               if (stricmp("Conferences",checkstr)==0) sprintf(checkstr,"%d",BBSGlobal->Conferences); else
  325.  
  326.               if (N_ND->User.Valid)
  327.               {
  328.                 if (stricmp("Handle",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.Handle); else
  329.                 if (stricmp("RealName",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.RealName); else
  330.                 if (stricmp("Group",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.Group); else
  331.                 if (stricmp("GeoLocation",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.GeoLocation); else
  332.                 if (stricmp("Country",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.Country); else
  333.                 if (stricmp("PhoneNumber",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.PhoneNumber); else
  334.                 if (stricmp("Password",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.Password); else
  335.                 if (stricmp("ComputerType",checkstr)==0) strcpy(checkstr,N_ND->User.CallData.ComputerType); else
  336.  
  337.                 if (stricmp("AccessName",checkstr)==0) strcpy(checkstr,HBBS_AccessName(N_ND->User.CallData.Access)); else
  338.                 if (stricmp("LastConf",checkstr)==0) strcpy(checkstr,HBBS_ListName(BBSGlobal->ConfList,N_ND->User.CallData.LastConf-1)); else
  339.                 if (stricmp("PreferedConf",checkstr)==0) strcpy(checkstr,HBBS_ListName(BBSGlobal->ConfList,N_ND->User.CallData.PreferedConf)); else
  340.  
  341.                 if (stricmp("Access",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.Access); else
  342.                 if (stricmp("UserID",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.UserID); else
  343.                 if (stricmp("UploadBytes",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.UploadBytes); else
  344.                 if (stricmp("DownloadBytes",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.DownloadBytes); else
  345.                 if (stricmp("UploadFiles",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.UploadFiles); else
  346.                 if (stricmp("DownloadFiles",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.DownloadFiles); else
  347.                 if (stricmp("A_UploadBytes",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.ActualUploadBytes); else
  348.                 if (stricmp("A_DownloadBytes",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.ActualDownloadBytes); else
  349.                 if (stricmp("A_UploadFiles",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.ActualUploadFiles); else
  350.                 if (stricmp("A_DownloadFiles",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.ActualDownloadFiles); else
  351.  
  352.                 if (stricmp("BestCPSUp",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.BestCPSUp); else
  353.                 if (stricmp("BestCPSDown",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.BestCPSDown); else
  354.                 if (stricmp("CallsMade",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.CallsMade); else
  355.                 if (stricmp("PagesMade",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.PagesMade); else
  356.                 if (stricmp("MessagesWritten",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.MessagesWritten); else
  357.                 if (stricmp("BRatio",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.BytesRatio); else
  358.                 if (stricmp("FRatio",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.FilesRatio); else
  359.                 if (stricmp("LastConfNum",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.LastConf); else
  360.                 if (stricmp("PreferedConfNum",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.PreferedConf); else
  361.                 if (stricmp("LinesPerScreen",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.LinesPerScreen); else
  362.                 if (stricmp("BytesAllowed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.BytesAllowed); else
  363.                 if (stricmp("TimeAllowed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.TimeAllowed); else
  364.                 if (stricmp("ChatAllowed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.ChatAllowed); else
  365.                 if (stricmp("CallsAllowed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.CallsAllowed); else
  366.                 if (stricmp("BytesUsed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.BytesUsed); else
  367.                 if (stricmp("TimeUsed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.TimeUsed); else
  368.                 if (stricmp("ChatUsed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.ChatUsed); else
  369.                 if (stricmp("CallsUsed",checkstr)==0) sprintf(checkstr,"%d",N_ND->User.CallData.CallsUsed); else
  370.                 if (stricmp("UserType",checkstr)==0) sprintf(checkstr,"%c",N_ND->User.CallData.UserType); else
  371.                 if (stricmp("Status",checkstr)==0) sprintf(checkstr,"%c",N_ND->User.CallData.Status);
  372.                 else
  373.                 strcpy(checkstr,errorstr);
  374.               }
  375.               else
  376.               strcpy(checkstr,errorstr);
  377.               sprintf(outstr,"%%%ss",formatstr);
  378.               sprintf(LineBuffer+strlen(LineBuffer),outstr,checkstr);
  379.             }
  380.           }
  381.         }
  382.       }
  383.       strcat(LineBuffer,tmpstr);  // and copy what's left..
  384.     }
  385.     PutText(LineBuffer);
  386.   }
  387.   while (bufferpos<Length);
  388.   PutText(ANSI_RESET);
  389.  
  390. }
  391.  
  392. V_BOOL DisplayScreen(char *ScreenName)
  393. {
  394.   BPTR FH,FL;
  395.   struct FileInfoBlock FIB;
  396.   UBYTE *buffer;
  397.   ULONG bytes;
  398.   BOOL retval=FALSE;
  399.  
  400.  
  401.   // if we are online or the activedoor is "Awaiting Connect"
  402.   // AND file exists then continue..
  403.  
  404.   if (((N_ND->OnlineStatus==OS_ONLINE) || ((N_ND->ActiveDoor) && (iposition("AWAITING CONNECT",N_ND->ActiveDoor->node.ln_Name)>=0))) &&
  405.       (AssignOK(ScreenName)) && (FL=Lock(ScreenName,ACCESS_READ)))
  406.   {
  407.     if (Examine(FL,&FIB))
  408.     {
  409.       if (FIB.fib_Size)
  410.       {
  411.         if (buffer=AllocVec(FIB.fib_Size,MEMF_PUBLIC))
  412.         {
  413.           if (FH=OpenFromLock(FL))
  414.           {
  415.             retval=TRUE;
  416.             if (bytes=Read(FH,buffer,FIB.fib_Size))
  417.             {
  418.  
  419.               if (FIB.fib_Size>3) //is file too small to be a file with a sequence in it ?
  420.               {  // No!
  421.                 // check the first three bytes and see if they are the same as the
  422.                 // sequence introducer.
  423.  
  424.                 if (strncmp(buffer,"@^@",3)==0)
  425.                 {
  426.                   // ok, this file may contain more sequences so we set the following flag.
  427.                   DisplayBuffer(buffer+3,bytes-3,TRUE); // +/- 3 to skip the @^@..
  428.                 }
  429.                 else DisplayBuffer(buffer,bytes,FALSE);
  430.  
  431.  
  432.               }
  433.               else
  434.               { // Yes, so read and display all the file...
  435.                 DisplayBuffer(buffer,bytes,FALSE);
  436.               }
  437.             }
  438.             Close(FH);
  439.             FL=NULL;
  440.  
  441.           }
  442.           FreeVec(buffer);
  443.         }
  444.       }
  445.     }
  446.     if (FL) UnLock(FL);
  447.   }
  448.   return(retval);
  449. }
  450.  
  451. /*
  452. void MenuPrompt(char *promptstr,char promptdefault)
  453. {
  454.   char tmpstr[1024];
  455.   char matchstr[4];
  456.   char replacestr[1024];
  457.  
  458.   strcpy(tmpstr,promptstr);
  459.  
  460.   if (promptdefault!=' ')
  461.   {
  462.     sprintf(matchstr,"[%c]",promptdefault);
  463.     sprintf(replacestr,"["ANSI_BOLD"%c"ANSI_RESET"]",promptdefault);
  464.  
  465.     replace(tmpstr,tmpstr,matchstr,replacestr);
  466.   }
  467.  
  468.   if (tmpstr[0]=='[')
  469.   {
  470.     strcpy(replacestr,ANSI_FG_BLUE "[" ANSI_FG_YELLOW);
  471.     strcat(replacestr,&tmpstr[1]);
  472.     strcpy(tmpstr,replacestr);
  473.   }
  474.  
  475.   replace(tmpstr,tmpstr," ["," "ANSI_FG_BLUE "[" ANSI_FG_YELLOW);
  476.   replace(tmpstr,tmpstr,"]",ANSI_FG_BLUE "]" ANSI_FG_WHITE);
  477.  
  478.   PutText(ANSI_RESET);
  479.   PutText(tmpstr);
  480. }
  481.  
  482.   V_STRING MenuTextANSI;            // default:     "white"
  483.   V_STRING MenuOpenBracket;         // default: [   "blue + ["
  484.   V_STRING MenuCloseBracket;        // default: ]   "blue + ]"
  485.   V_STRING MenuHighlightANSI;       // default:     "yellow"
  486.   V_STRING MenuDefaultOptANSI;      // default:     "bold + white"
  487.   V_STRING MenuPromptANSI;          // default:  :  " blue + : "
  488.  
  489. */
  490.  
  491. void MenuPrompt(char *promptstr,char promptdefault)
  492. {
  493.   char tmpstr[1024];
  494.   char matchstr[4];
  495.   char replacestr[1024];
  496.  
  497.   strcpy(tmpstr,promptstr);
  498.  
  499.   if (promptdefault!=' ')
  500.   {
  501.     sprintf(matchstr,"[%c]",promptdefault);
  502.     sprintf(replacestr,"%s%s%c%s",N_ND->BBSCols->MenuOpenBracket,N_ND->BBSCols->MenuDefaultOptANSI,promptdefault,N_ND->BBSCols->MenuCloseBracket);
  503.  
  504.     replace(tmpstr,tmpstr,matchstr,replacestr);
  505.   }
  506.  
  507.   if (tmpstr[0]=='[')
  508.   {
  509.     strcpy(replacestr,N_ND->BBSCols->MenuOpenBracket);
  510.     strcat(replacestr,N_ND->BBSCols->MenuHighlightANSI);
  511.     strcat(replacestr,&tmpstr[1]);
  512.     strcpy(tmpstr,replacestr);
  513.   }
  514.  
  515.   replacestr[0]=' ';
  516.   replacestr[1]=0;
  517.   strcat(replacestr,N_ND->BBSCols->MenuOpenBracket);
  518.   strcat(replacestr,N_ND->BBSCols->MenuHighlightANSI);
  519.   replace(tmpstr,tmpstr," [",replacestr);
  520.  
  521.   strcpy(replacestr,N_ND->BBSCols->MenuCloseBracket);
  522.   strcat(replacestr,N_ND->BBSCols->MenuTextANSI);
  523.   replace(tmpstr,tmpstr,"]",replacestr);
  524.  
  525.   PutText(ANSI_RESET);
  526.   PutText(tmpstr);
  527. //  PutText(N_ND->BBSCols->MenuPromptANSI);
  528. }
  529.